<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <cpn1></cpn1>
     </div>
     <!--script标签，必须是 text/x-template-->
    <!-- <script type="text/x-template" id="cpn1">
        <div>
            <h2>1111111</h2>
        </div>
    </script> -->
 <!--template标签-->
 <template id="cpn1">
    <div>
        <h2>templatetemplatetemplatetemplate</h2>
    </div>
 </template>
    <script src="../js/vue.js"></script>
    <script>    
        //注册一个全局组件
        Vue.component('cpn1',{
            template:'#cpn1'
        })
        //root 组件
        const app=new Vue({
            el:'#app',
            data:{
                message: "你好"
            }
        })
    </script>
</body>
</html>